<?php

/**
 * 
 */
class MenuItem extends CActiveRecord {
	
	public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }
	
	public function tableName()
	{
		return '{{menuitem}}';
	}
	
	public function scopes()
    {
        return array(
            'renderMenu'=>array(
                'condition'=>'enabled=1',
                'order'=>'sequence_number ASC'
            ),
        );
    }
	
	public function getParams(){
		$return = array();
		if(isset($this->params)){
			$paramArray = split(';', $this->params);
			foreach ($paramArray as $param) {
				$splitparam = split('=', $param);
				$return[$splitparam[0]] = $splitparam[1];
			}
		}
		return $return;
	}
	
	private $active;
	
	public function isActive(){
		return $this->active;
	}
	
	public function setActive($active){
		$this->active = $active;
	}
}
